home *** CD-ROM | disk | FTP | other *** search
/ World of Education / World of Education.iso / world_j / jethro11.zip / JETHRO.L < prev   
Text File  |  1993-06-11  |  7KB  |  264 lines

  1.  
  2.  /* jethro.l */
  3.  
  4.  /* 
  5.  **   jethro  v. 1.01 06/11/93
  6.  **   Duane Paulson <ci922@cleveland.freenet.edu> "dap"
  7.  **   Hillbilly text filter. Compile with lex, then C.
  8.  **   syntax will be:
  9.  **      jethro <input_file >output_file.
  10.  **   Public domain. Use at your own risk. Y'all come back now, heah?
  11.  */
  12.  /*************************************************************************
  13.                 REVISION LOG
  14.  when      ver   who  change
  15.  --------  ----  ---  -----------------------------------------------------
  16.  06/11/93  1.01  dap  Had rule for "relax" mixed in with rules for
  17.               "automobile" definitions. Turrible! Fixed.
  18.  06/10/93  1.00  dap  Initial release.
  19.  *************************************************************************/
  20.  
  21. SW    [\n \"(]
  22. EW    [\n ".",\"!?):;]
  23. BW    [\n ]
  24.  
  25.     #define PUTLAST unput(*(yytext+strlen(yytext)-1));
  26.     #define SUB(A) fprintf(yyout, "%c%s", *A|(*yytext&32), A+1);
  27.     #define SSUB(A) fprintf(yyout, "%c%c%s", *yytext,\
  28.         *A|(*(yytext+1)&32), A+1);
  29.     #define SESUB(A) fprintf(yyout, "%c%c%s", *yytext,\
  30.         *A|(*(yytext+1)&32), A+1); PUTLAST;
  31.     #define ESUB(A) fprintf(yyout, "%c%s", *A|(*yytext&32), A+1); PUTLAST;
  32.  
  33.     #include <string.h>
  34.  
  35. %%
  36.  
  37. {SW}[Gg]reetings{EW}    |
  38. {SW}[Hh]i{EW}        |
  39. {SW}[Hh]ello{EW}    SESUB("Howdy");
  40. {SW}[Bb]ye{EW}        |
  41. {SW}[Gg]oodbye{EW}    SESUB("Y'all come back now, heah?");
  42. {SW}[Hh]ear{EW}    SESUB("Heah");
  43. {SW}[Rr]elax{EW}    SESUB("Set a spell -- put yore feet up");
  44. {SW}[Cc]ar{EW}        |
  45. {SW}[Aa]uto{EW}        |
  46. {SW}[Aa]utomobile{EW}    SESUB("Gasoline buggy");
  47. [Ss]wimming{BW}pool    SUB("Cement pond");
  48. [Pp]ool{BW}table    SUB("Fancy eatin table");
  49. [Pp]ool{BW}cue        |
  50. [Cc]ue{BW}stick        SUB("Fancy pot passer");
  51. {SW}[Bb][r]?oil{EW}    |
  52. {SW}[Bb]ake{EW}        |
  53. {SW}[Ff]ry{EW}        |
  54. {SW}[Ss]aute{EW}    |
  55. {SW}[Cc]ook{EW}    SESUB("Whomp up");
  56. {SW}[Bb][r]?oiling{EW}    |
  57. {SW}[Bb]akeing{EW}    |
  58. {SW}[Ff]rying{EW}    |
  59. {SW}[Ss]auteing{EW}    |
  60. {SW}[Cc]ooking{EW}    SESUB("Whompin up");
  61. {SW}[Bb][r]?oiled{EW}    |
  62. {SW}[Bb]aked{EW}    |
  63. {SW}[Ff]ryed{EW}    |
  64. {SW}[Ss]auted{EW}    |
  65. {SW}[Cc]ooked{EW}    SESUB("Done whomped up");
  66. {SW}[Bb][r]?oils{EW}    |
  67. {SW}[Bb]akes{EW}    |
  68. {SW}[Ff]rys{EW}        |
  69. {SW}[Ss]autes{EW}    |
  70. {SW}[Cc]ooks{EW}    SESUB("Whomps up");
  71. {SW}[Gg]roceries{EW}    |
  72. {SW}[Ff]ood{EW}        SESUB("Vittles");
  73. [Ss]alad        SUB("Slaw");
  74. [Vv]egetable        SUB("Green");
  75. [Pp]otato        SUB("Tater");
  76. {SW}[Tt]omato        SSUB("Tuhmater");
  77. {SW}[Rr]hubarb{EW}    SESUB("Pie plant");
  78. {SW}[Ll]iquor{EW}    |
  79. {SW}[Ww]hisk[e]?y{EW}    |
  80. {SW}[Ss]cotch{EW}    |
  81. {SW}[Bb]ourbon{EW}    |
  82. {SW}[Gg]in{EW}        |
  83. {SW}[Vv]odka{EW}    |
  84. {SW}[Tt]equila{EW}    |
  85. {SW}[Ll]iqueur{EW}    SESUB("Rheumatiz medcin");
  86. {SW}[Bb]ooze{EW}    SESUB("Corn likker");
  87. {SW}[Cc]ocktail{EW}    |
  88. {SW}[Mm]ixed{BW}drink{EW} SESUB("Waste of good likker");
  89. {SW}[Bb]ar{EW}        SESUB("Dance hall");
  90. {SW}[Bb]ars{EW}        SESUB("Dance halls");
  91. {SW}[Ss]aloon        |
  92. {SW}[Cc]ocktail{BW}lounge SESUB("Dance hall");
  93. {SW}[Ww]hore        |
  94. {SW}[Pp]rostitute    |
  95. {SW}[Ss]lut        SSUB("Dance hall girl");
  96. {SW}[Ss]ecret{BW}agent{EW} |
  97. {SW}[Ss]py{EW}        |
  98. {SW}007{EW}        SESUB("Double nought spy");
  99. {SW}[Zz]ero{EW}        SESUB("Nought");
  100. {SW}[Pp]ants{EW}    SESUB("Trousers");
  101. {SW}[Jj]eans{EW}    |
  102. {SW}[Dd]ungarees{EW}    |
  103. {SW}[Ll]evi[']?s{EW}    SESUB("Overhalls");
  104. {SW}[Ss]hoe        SSUB("High-button shoe");
  105. {SW}[Jj]acket        SSUB("Coat");
  106. {SW}[Ss]hotgun        SSUB("Fowlin piece");
  107. {SW}[Rr]evolver        |
  108. {SW}[Gg]un        SSUB("Shootin iron");
  109. {SW}[Rr]ifle        SSUB("Ozark longrifle");
  110. {SW}[Ll]ibrar[yi]    SSUB("Liberry");
  111. [Ww]ash            SUB("Warsh");
  112. [Ff]amily        SUB("Fambly");
  113. [Ff]ry{BW}pan        |
  114. [Ff]rying{BW}pan    |
  115. [Ss]aute{BW}pan        SUB("Skillet");
  116. {SW}[Aa]nimal        SSUB("Critter");
  117. {SW}FBI{EW}        |
  118. {SW}F.B.I.{EW}        |
  119. {SW}CIA{EW}        |
  120. {SW}C.I.A.{EW}        |
  121. {SW}ATF{EW}        |
  122. {SW}A.T.F.{EW}        |
  123. {SW}IRS{EW}        |
  124. {SW}I.R.S.{EW}        |
  125. {SW}SS{EW}        |
  126. {SW}S.S.{EW}        |
  127. {SW}[Ss]elective{BW}[Ss]ervice{EW} |
  128. {SW}[Ss]elective{BW}[Ss]ervice{BW}[Ss]ystem{EW} |
  129. {SW}[Ss]ecret{BW}[Ss]ervice{EW} SESUB("Revanooers");
  130. {SW}[Pp]olice        |
  131. {SW}[Pp]oliceman    |
  132. {SW}[Ss]heriff        |
  133. {SW}[Dd]eputy        |
  134. {SW}[Dd]eputy{BW}[Ss]heriff |
  135. {SW}[Mm]arshall        |
  136. {SW}[Dd]eputy{BW}[Mm]arshall |
  137. {SW}[Pp]ark{BW}[Rr]anger |
  138. {SW}[Tt]exas{BW}[Rr]anger |
  139. {SW}[Hh]ighway{BW}[Pp]atrol SSUB("Constable");
  140.  
  141. {SW}[Mm]other        |
  142. {SW}[Mm][ao]mm[ay]?     |
  143. {SW}[Mm]ommie        |
  144. {SW}[Mm]om        SSUB("Maw");
  145. {SW}[Mm]a{EW}        SESUB("Maw");
  146. {SW}[Ff]ather        SSUB("Paw");
  147. {SW}[Dd]ad{EW}        |
  148. {SW}[Dd]addy        |
  149. {SW}[Pp]a{EW}        |
  150. {SW}[Pp][ao]p{EW}    |
  151. {SW}[Pp][ao]pp[ay]?{EW} SESUB("Paw");
  152. {SW}[Gg]randmother{EW}    |
  153. {SW}[Gg]randma[w]?{EW}    SESUB("Granny");
  154. {SW}[Gg]randfather{EW}    |
  155. {SW}[Gg]ran[d]{1,2}ad[d]?[y]?{EW} |
  156. {SW}[Gg]randpop{EW}    |
  157. {SW}[Gg]randpa[w]?{EW}    SESUB("Grampy");
  158. {SW}[Mm]y{EW}        SESUB("Mah");
  159. {SW}them{EW}        SESUB("em");
  160. [Dd]og            SUB("Dawg");
  161. [Ll]awyer        |
  162. [Ll]egal{BW}counc[ei]l    |
  163. [Ll]egal{BW}councellor    |
  164. [Aa]ttorney        |
  165. [Aa]ttorney{BW}[Aa]t{BW}[Ll]aw SUB("City slicker");
  166.  
  167. {SW}[Tt]han{EW}        SESUB("Then");
  168. [Cc]haracterize        SUB("Show");
  169. {SW}[Vv]ery{EW}        |
  170. {SW}[Ee]xtremely{EW}    |
  171. {SW}[Rr]eally{EW}    |
  172. {SW}[Rr]eal{EW}        SESUB("Right");
  173. {SW}[Hh]aven't{EW}    |
  174. {SW}[Ii]sn't{EW}    |
  175. {SW}[Aa]ren't{EW}    SESUB("Aint");
  176. {SW}[Ss]aid{EW}        |
  177. {SW}[Ss]ays{EW}        SESUB("Sez");        
  178. {SW}[Aa]re{EW}        SESUB("Is");
  179. {SW}[Ss]hould{EW}    SESUB("Ortta");
  180. {SW}[Pp]erhaps{EW}    |
  181. {SW}[Mm]aybe{EW}    SESUB("Mebbe");
  182. {SW}[Ss]ick{EW}        SESUB("Ailin'");
  183. {SW}I'm{BW}not{EW}    SESUB("I aint");
  184. {SW}[Ss]cared{EW}    SESUB("A-skeert");
  185. {SW}[Ss]care        SSUB("Skeer");
  186. {SW}[Hh]ave{EW}        SESUB("Got");
  187. {SW}[Pp]ossess{EW}    SESUB("Have");
  188. {SW}[Hh]elp        SSUB("Hep");
  189. {SW}[Tt]ired{EW}    SESUB("Tuckered out");
  190. {SW}[Cc]ompletely{EW}    SESUB("Plumb");
  191. {SW}[Dd]runk{EW}    SESUB("A mite woozy");
  192.  
  193. {SW}[Yy]es{EW}        SESUB("Yep");
  194. {SW}[Nn]o{EW}        SESUB("Nope");
  195.  
  196. {SW}[Ii]t{BW}is{EW}    SESUB("Tis");
  197. {SW}[Aa]t{BW}all{EW}    *(yytext+1)=(char)'A'; SESUB("A tall");
  198.  
  199. {SW}[Aa]m{EW}        |
  200. {SW}[Aa]re{EW}        SESUB("Is");
  201. {SW}[Ww]as{EW}        |
  202. {SW}[Ww]ere{EW}        SESUB("Wuz");
  203. {SW}[Ww]asn't{EW}    SESUB("Wasunt");
  204. [Ee]very        SUB("Ever");
  205. {SW}[Ww]ant/s        SSUB("Is after");
  206. {SW}[Ww]anted{EW}    SESUB("Was after");
  207. {SW}[Ww]anting{EW}    SESUB("Hankering after");
  208. {SW}[Dd]oesn't{EW}    |
  209. {SW}[Dd]on't{EW}    SESUB("Dasent");
  210. {SW}[Yy]ou'll{EW}    SESUB("Y'all will");
  211. {SW}[Yy]our        SSUB("Yore");
  212. {SW}[Mm]ore{EW}        SESUB("Mo");
  213. tial            SUB("shul");
  214. cious            SUB("shus");
  215. ious            SUB("yus");
  216. tion            SUB("shun");
  217. {SW}[Cc]an{EW}        SESUB("C'n");
  218. {SW}[Yy]ou{EW}        SESUB("Y'all");
  219. {SW}[Ff]or{EW}        SESUB("Fer");
  220. {SW}[Tt]he{EW}        SESUB("Duh");
  221. ing            SUB("in");
  222. {SW}[Tt]oo{EW}        SESUB("Besides");
  223. {SW}[Tt]o{EW}        SESUB("Tuh");
  224. {SW}[Aa][n]?{EW}    SESUB("Ah");
  225. {SW}[Aa]re{EW}        |
  226. {SW}[Oo]ur{EW}        |
  227. {SW}[Oo]r{EW}        SESUB("Ore");
  228. {SW}[Oo]f{EW}        SESUB("Uv");
  229. {SW}I{EW}        SESUB("Ah");
  230. {SW}I'm{EW}        SESUB("Ahm a");
  231. {SW}I'll{EW}        SESUB("Ahl");
  232. {SW}I'd{EW}        SESUB("Ah wood");
  233. 'nt            *(yytext)=(char)'u'; SUB("unt");
  234. 're            SUB(" is");
  235. 've            SUB(" done");
  236. eed{EW}            ECHO;
  237. ed{EW}            ESUB("d");
  238. {SW}[Oo]wn{EW}        |
  239. {SW}[Tt]own{EW}        |
  240. {SW}[Dd]own{EW}        |
  241. {SW}[Gg]own{EW}        |
  242. {SW}[Bb]rown{EW}    ECHO;
  243. wn{EW}            ESUB("ed");
  244. {SW}[Bb]elow{EW}    |
  245. {SW}[Kk]now{EW}        |
  246. {SW}[Tt]hrow{EW}    |
  247. {SW}[Gg]row{EW}        |
  248. {SW}[Hh]ow{EW}        |
  249. {SW}[Nn]ow{EW}        |
  250. {SW}[Bb]row{EW}        |
  251. {SW}[Ss]how{EW}        ECHO;
  252. ow{EW}            ESUB("er");
  253. re{EW}            |
  254. er{EW}            ESUB("uh");
  255. {SW}[Hh]er{EW}        ECHO;
  256. !            SUB(". Ye DAWGies!!!");
  257.  
  258. %%
  259.  
  260. main()
  261. {
  262.     yylex();
  263. }
  264.